import React, { Component } from 'react';
import {
  withRouter, Link, Switch, Redirect, Route, HashRouter as Router
} from 'react-router-dom'
import { Layout, Menu, Icon, Button, Table, Form, Divider, Modal, Input, Radio } from 'antd';

import SystemKeywords from './system-keywords'//关键词
import SystemIndex from './system-index'//首页管理
import SystemLog from './system-log'//日志管理
import SystemRange from './system-range'//采集范围设置
import SystemBlackList from './system-blackList'//黑名单
import SystemNotice from './system-notice'//系统公告
import SystemWarning from './system-warning'//系统预警
import Keywords2 from './system-words2'//智能模式
import Loading from "./../loading"//加载中样式
import $ from "jquery"
// import syTable from './system-table.jsx'



import "../../static/systemSetup/system-base.styl"

const { SubMenu } = Menu;
const { Header, Content, Sider } = Layout;
const FormItem = Form.Item;
const RadioGroup = Radio.Group;


export default class SystemBase extends React.Component {
  //表格配置项
  state = {
    selectedRowKeys: [],
    visible: false,
    value: 1,
  }

  start = () => {
    setTimeout(() => {
      this.setState({
        selectedRowKeys: [],

      });
    }, 1000);
  }
  //复选框
  onSelectChange = (selectedRowKeys) => {

    this.setState({ selectedRowKeys });
  }
  //弹出框
  addKeywords = () => {
    this.setState({
      visible: true,
    });
  }
  //点击确定
  handleOk = (e) => {

    this.setState({
      visible: false,
    });
  }
  //点击取消
  handleCancel = (e) => {

    this.setState({
      visible: false,
    });
  }
  //单选框
  onChange = (e) => {
  
    this.setState({
      value: e.target.value,
    });
  }
  setKey(key) {
    sessionStorage.setItem('systemkeyword', key)

  }
  render() {
    const state = this.state;

    const { selectedRowKeys } = this.state;
    const rowSelection = {
      selectedRowKeys,
      onChange: this.onSelectChange,
    };
    const hasSelected = selectedRowKeys.length > 0;
    return (


      <Router className="basicShow"  >
        <div className="container" style={{ display: "none" }}>
          <Layout>
            <Sider width={200} style={{ background: '#fff' }}>
              <Menu
                mode="inline"
                defaultSelectedKeys={[sessionStorage.getItem('systemkeyword') || '1']}
                defaultOpenKeys={['sub1']}
                style={{ height: '100%', borderRight: "1px solid #eee", paddingTop: "10%" }}
              >
                <Menu.Item key="1"
                  onClick={() => {
                    this.setKey('1')
                  }}
                ><Link to='/systemBase/systemKeywords'>监测关键词</Link></Menu.Item>
                <Menu.Item key="2"
                  onClick={() => {
                    this.setKey('2')
                  }}><Link to='/systemBase/systemIndex'>首页管理</Link></Menu.Item>
                <Menu.Item key="7"
                  onClick={() => {
                    this.setKey('3')
                  }}><Link to='/systemBase/systemWarning'>预警设置</Link></Menu.Item>
                {/* <Menu.Item key="3"><Link to='/systemLog'>日志管理</Link></Menu.Item> */}
                <Menu.Item key="4"
                  onClick={() => {
                    this.setKey('4')
                  }}><Link to='/systemBase/systemRange'>采集范围设置</Link></Menu.Item>
                <Menu.Item key="5"
                  onClick={() => {
                    this.setKey('5')
                  }}><Link to='/systemBase/systemBlackList'>黑名单</Link></Menu.Item>
                {/* <Menu.Item key="6"><Link to='/systemNotice'>系统公告</Link></Menu.Item> */}

              </Menu>
            </Sider>
            <Layout>
              <Content style={{ background: '#fff', margin: 0, minHeight: 280, overflowY: "hidden" }}>
                <Switch>
                  <Route path='/systemBase/systemKeywords' component={SystemKeywords} />
                  <Route path='/systemBase/Keywords2' component={Keywords2} />
                  <Route path='/systemBase/systemIndex' component={SystemIndex} />
                  <Route path='/systemBase/systemWarning' component={SystemWarning} />
                  {/* <Route path='/systemLog' component={SystemLog}/> */}
                  <Route path='/systemBase/systemRange' component={SystemRange} />
                  <Route path='/systemBase/systemBlackList' component={SystemBlackList} />
                  {/* <Route path='/systemNotice' component={SystemNotice}/> */}
                  
                </Switch>

              </Content>
            </Layout>
          </Layout>

        </div>
      </Router>

    );
  }
}